package gui;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

import principal.Camera;
import principal.Cena;

public class Tela extends JPanel {
	
	private static int phong = 0;
    private static int gouraud = 1;
    private static int flat = 2;
    private static int aleatoria = 4;   
		
	private Cena cena;
	private Graphics graphics;
	private int algoritmo;	

	public Tela(Cena c){
		this.cena = c;
		this.setLayout(null);
		System.out.println(this.cena.getCamera().getHx());
		this.setSize((int)this.cena.getCamera().getHx(), (int)this.cena.getCamera().getHy());
		this.setBackground(new Color(0,0,0));
		
		//this.algoritmo = algoritmo;		
	}

	public Cena getCena() {
		return this.cena;
	}

	public int getAlgoritmo() {
		return algoritmo;
	}

	public void setAlgoritmo(int algoritmo) {
		this.algoritmo = algoritmo;
	}	
	
	

	public void paintComponent(Graphics graficos){
		
		this.setSize((int)this.cena.getCamera().getHx(),(int)this.cena.getCamera().getHy());
		
		graphics = cena.pintarTelaFlat(graficos);
		
		if(algoritmo == phong){
			//graphics = camera.pintarTelaPhong(graficos);
		}
		else
			if(algoritmo == gouraud){
				//graphics = repositorio.pintarTelaGouraud(graficos);
			}
			else
				if(algoritmo == flat){
					//graphics = repositorio.pintarTelaFlat(graficos);
				}
				else
					if(algoritmo == 3){
						//graphics = repositorio.pintarTelaPhongBumpMapping(graficos, repositorio.getBumFactor());
					}
					else
						if(algoritmo == aleatoria){
							//graphics = repositorio.pintarTelaAleatoriamente(graficos);
						}
							
					

	}
	
	public static int getPhong() {
		return phong;
	}

	public static int getGouraud() {
		return gouraud;
	}

	public static int getFlat() {
		return flat;
	}

	public static int getAleatoria() {
		return aleatoria;
	}


}
